import { defineStore } from 'pinia'

import { 
  getLifeList 
} from '@/service/blog/life'

interface lifeState{
  lifeList: any[],
  total: number
}

const useLifeStore = defineStore('life', {
  state: ():lifeState => ({
    lifeList: [],
    total: 0
  }),
  actions: {
    getLifeListAction(queryInfo: any = {}) {
      getLifeList(queryInfo).then(res => {
        // console.log(res)
        this.lifeList = res.data.result
        this.total = res.data.total
      })
    }
  }
})

export default useLifeStore